//
//  ViewController.m
//  UIViewTest
//
//  Created by dllo on 16/6/7.
//  Copyright © 2016年 司昌宝. All rights reserved.
//

#import "ViewController.h"
#import "SITextField.h"
#import "SILabel.h"
#import "SIView.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSArray *labelArray = @[@"用户名",@"密码",@"确认密码",@"手机",@"邮箱"];
    NSArray *textFieldArray = @[@"请输入用户名",@"请输入密码",@"再次输入密码",@"请输入联系方式",@"请输入邮箱"];
    for (int i = 0;i < 5;i++){
        [self createViewWithFrame:CGRectMake(50, 50+ (i * 80), 380, 50) withTextForLabel:labelArray[i] withTextForTextField:textFieldArray[i]];
    }
    
    
    
    
 //   [self createViewWithFrame:CGRectMake(50, 50, 380, 50) withTextForLabel:@"用户名" withTextForTextField:@"请输入用户名"];
    
    
}

-(void)createViewWithFrame:(CGRect)frame withTextForLabel:(NSString *)text1 withTextForTextField:(NSString *)text2{
    SIView *aView = [[SIView alloc] initWithFrame:frame withText:text1 withAnotherText:text2];
    aView.textField.delegate = self;
    [self.view addSubview:aView];
    
    [aView release];
}

-(BOOL)textFieldShouldReturn:(UITextField *)textField{
    [textField resignFirstResponder];
    return YES;
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
